try:
    print(stu)
except BaseException as e:
    print(e)
print('hello world')

try:
    print(stu)
except Exception as e:
    print(e)
print('hello')

try:
    print(stu)
except NameError as e:
    print(e)
print('hello')

try:
    print(stu)
except Exception as e:
    print(e)
else:
    print('正常执行')
print('hello')

# 综合案例：
print('----------------------------')
list_a = [123, 34, 11, 0, 10]
# 遍历列表，打印10除以每个值的结果，如果有异常，请捕获
i = 1
for num in list_a:
    try:
        print(f'第{i}次执行，结果是:', end='')
        print(10 / num)
    except Exception as e:
        print(f'出现异常：{e}')
    else:
        print('正常执行')
    finally:
        print('执行完成')
        i += 1
